const fs = require("fs");

/* fs.readFile('../files/chengji.txt','utf8',(err,data)=> {
    if(err) return console.log(err)

    let str = data;
    let arr = str.split(' ');
    let newStr = '';
    for (let i =0;i<arr.length;i++) {
        let everyStr = arr[i].replace('=',': ')
        newStr += everyStr + '\n'
    }
    console.log(newStr)
    fs.writeFile('../files/chengji-ok.txt',newStr,'utf8',(err)=> {
        console.log(err)
    })
})

fs.readFile('../files/chengji.txt','utf8',(err,data)=> {
    if(err) return console.log(err)

    let str = data;
    let arr = str.split(' ');
    let newStr = '';
    for(let i =0;i<arr.length;i++) {
        let everyStr = arr[i].replace('=',' ');
        newStr += everyStr + '\n'
    }
    console.log(newStr)
    fs.writeFile('../files/chengji-ok.txt',newStr,'utf8',(err)=> {
        console.log(err)
    })
}) */

fs.readFile('../files/chengji.txt','utf8',(err,data)=> {
    if(err) return console.log(err)

    let str = data;
    let arr = str.split(' ');
    let newStr = '';
    for(let i =0;i<arr.length;i++) {
        let everyStr = arr[i].replace('=',' ');
        newStr += everyStr + '\n'
    }
    console.log(newStr)
    fs.writeFile('../files/chengji-ok.txt',newStr,'utf8',(err)=> {
        console.log(err)
    })
})